{extend name="iframe" /}
{block name="css"}
<style type="text/css">
    .layui-card .layui-card-body .layui-form{padding-top: 0px !important; }
    .layui-card {box-shadow: none;}
</style>
{/block}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-header">
      成绩统计分析-{$paperinfo['id']|get_exam_title}
    </div>
    <div class="layui-card-body">
        <table id="analysisTable" class="commontable" style="margin-left:15px;width:97%">
            <tbody><tr>
                <td class="title" id="sAttendTotalNum">参加人数<br><br><span class="analysis" id="attendNum">{$count}</span></td>
                <td class="title">通过人数<br><br><span class="analysis" id="passNum">{$passNum}</span></td>
                <td class="title">未通过人数<br><br><span class="analysis" id="nonPassNum">{$noPassNum}</span></td>
                <td class="title">通过率<br><br><span class="analysis" id="passRate">{$pass}</span>%</td>
                <td class="title">最高分<br><br><span class="analysis" id="maxScore">{$maxScore}</span></td>
                <td class="title">最低分<br><br><span class="analysis" id="minScore">{$minScore}</span></td>
                <td class="title">平均分<br><br><span class="analysis" id="avgScore">{$avgScore}</span></td>
            </tr>
            </tbody>
        </table>
        <input type="hidden" id="eid" value="{$paperinfo['id']}">
        <table class="layui-hide" id="analysis"></table>
    </div>
    <div class="layui-row  learn-bottom">
        <a href="{:url('admin/exam/export',['eid'=>$paperinfo['id']])}" class="layui-btn layui-btn-primary"><i class="fa fa-file-excel-o"></i> 导出成绩</a>
    </div>
</div>
{/block}
{block name="js"}
<script>
    layui.use('table', function(){
        var table = layui.table;
        var eid=$('#eid').val();
        table.render({
            elem: '#analysis'
            ,url:'/admin/exam/useranalysis/id/'+eid
            ,page: {
                layout: ['limit', 'count', 'prev', 'page', 'next', 'skip']
                ,groups: 1 //只显示 1 个连续页码
                ,first: false //不显示首页
                ,last: false //不显示尾页
            }
            ,cols: [[
                {field:'username', width:152, title: '姓名'}
                ,{field:'totalscore', width:125, title: '试卷总分'}
                ,{field:'passscore', width:125, title: '通过分数'}
                ,{field:'score', width:120, title: '考试成绩', sort: true}
                ,{field:'ispass', width:130,title: '是否通过考试'}
                ,{field:'addtime', width:190, title: '交卷时间', sort: true}
                ,{field:'sort', width:90, title: '排名', sort: true}
            ]]

        });
    });
</script>
{/block}
